package com.inspinia.message.common.model;

import java.util.ResourceBundle;

/**
 * 消息通知通道类型
 * @author Veblen
 */
public class NoticeConfig {

    public static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("notice");

    public static final MQType NOTICE_MQ_TYPE = MQType.valueOf(Integer.valueOf(RESOURCE_BUNDLE.getString("mq.type")));

    public enum MQType {
        NONE,
        REDIS,
        RABBITMQ;

        public static MQType valueOf(int ordinal) {
            if (ordinal < 0 || ordinal >= values().length) {
                throw new IndexOutOfBoundsException("Invalid ordinal");
            }
            return values()[ordinal];
        }
    }
}
